<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
  <div id="app">
    <input type="text" v-damu>
  </div>
</body>
<script src="../js/vue.js"></script>
<script src="./js/moment.js"></script>
<script>
  Vue.config.productionTip = false;
  Vue.directive('damu', {
    // 当被绑定的元素插入到 DOM 中时……
    inserted: function (el) {
      // 聚焦元素
      el.focus()
    }
  })

  new Vue({
    el:"#app",
    /*directives:{
      damu: {
        // 钩子!  vue会自动调用!!!
        inserted: function (el) {
          //el: 当前指令所处的节点!!!!
          el.focus()
        }
      }
    }*/
  })
</script>
</html>